package com.csdj.youxi.service;

import com.csdj.youxi.entity.AdPromotion;
import com.csdj.youxi.entity.AdPromotionExample;
import com.csdj.youxi.mapper.AdPromotionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdPromotionService implements IAdPromotionService{
    @Autowired
    private AdPromotionMapper adPromotionMapper;

    @Override
    public List<AdPromotion> selAp() {
        AdPromotionExample adPromotionExample = new AdPromotionExample();
        adPromotionExample.createCriteria();
        List<AdPromotion> list = adPromotionMapper.selectByExample(adPromotionExample);
        return list;
    }

    @Override
    public int insertAp(AdPromotion adPromotion) {
        return adPromotionMapper.insert(adPromotion);
    }

    @Override
    public int updateAp(AdPromotion adPromotion) {
        return adPromotionMapper.updateByPrimaryKey(adPromotion);
    }

    @Override
    public int deleteAp(int id) {
        return adPromotionMapper.deleteByPrimaryKey(id);
    }
}
